<#assign menu="default">
<#assign submenu="">
<#include "head.ftl">
<style>
.dd-handle {
    -moz-box-sizing: border-box;
    background: none repeat scroll 0 0 #F5F5F5;
    border: 1px solid #CCCCCC;
    color: #333333;
    cursor: move;
    display: block;
    font-weight: bold;
    height: 30px;
    margin: 5px 0;
    padding: 5px 10px;
    text-decoration: none;
}
.list-group-item {
    background-color: #FFFFFF;
    border: 1px solid #DDDDDD;
    display: block;
    margin-bottom: -1px;
    padding: 3px 15px;
    position: relative;
    font-size:18px;
}
</style>
<body>
<section id="main-content">
    <section class="wrapper">
        <section class="panel">

            <div class="tab-content">

                <div class="tab-pane active" id="tab_2">
                    <div class="portlet box green">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-gift"></i>用户管理
                            </div>
                        </div>
                        <div class="portlet-body">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <form method="post" action="${basePath}/admin/appUser/add.htm">
                                            <div class="row">



                                                <div class="col-md-offset-11 col-md-1">
                                                    <button id="genpassword" class="btn btn-success" type="submit"
                                                            ><i class="fa fa-arrow-left fa-fw"></i>
                                                        查找
                                                    </button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>


                            <div class="panel-body">
                                <div class="adv-table">
                                    <div role="grid" class="dataTables_wrapper" id="hidden-table-info_wrapper">
                                        <table class="table table-striped table-advance table-hover">
                                            <thead>
                                            <tr>
                                                <th>名字</th>
                                                <th>udId</th>
                                                <th>手机号</th>
                                                <th>
                                                    微信/微博
                                                </th>
                                                <th>性别</th>
                                                <th>签名</th>

                                                <th>职位</th>
                                                <th>兴趣</th>

                                                <th>用户类型</th>
                                                <th>状态</th>
                                                <th>是否红人</th>
                                                <th>操作</th>

                                            </tr>
                                            </thead>
                                            <tbody role="alert" aria-live="polite" aria-relevant="all">
                                            <#list pageVo.list as e>
                                            <tr class="gradeA odd">
                                                <td>
                                                <#--<a href="${basePath}/manage/goods/update.htm?goodsId=${e.id}">${e.name}</a>-->
                                    ${e.name}
                                                </td>
                                                <td>${e.udId!}</td>
                                                <td>${e.phone!}</td>
                                                <td>${e.weChatId!}</td>
                                                <td>
                                                    <#if e.gender==1> 男</#if>
                                                    <#if e.gender==0> 女</#if>
                                                </td>
                                                <td>${e.signature!}</td>
                                                <td>${e.profession}</td>
                                                <td>${e.interests}</td>
                                                <td>
                                                    <#if e.type==0> 手机</#if>
                                                    <#if e.type=1> 微信</#if>
                                                    <#if e.type=2> 微博</#if>
                                                    <#if e.type=3> 系统</#if>
                                                </td>

                                                <td>
                                                    <#if e.available==1>在用</#if>
                                                    <#if e.available==0>禁用</#if>
                                                </td>
                                                <td>
                                                    <#if e.isHot==1>
                                                        是
                                                    <#else>
                                                        否
                                                    </#if>

                                                </td>
                                                <td>
                                                    <#if e.available==1>
                                                        <a href="javascript:void(0);" class="js_appUser_delete btn btn-success" appUserId="${e.id}"
                                                           title="是否禁用此账号">
                                                            禁用
                                                        </a>
                                                    </#if>
                                                    <#if e.available==0>
                                                        <a href="javascript:void(0);" class="js_appUser_on btn btn-success" appUserId="${e.id}"
                                                           title="是否启用此账号">
                                                            启用
                                                        </a>
                                                    </#if>

                                                </td>
                                            </tr>
                                            </#list>
                                            </tbody>
                                        </table>
                                        <div style="height: 30px;">
                                            <div class="pagination">${pageVo.pageNumHtml} </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


        </section>
    </section>

</section>
</body>



<script>
    $(function () {
        var pageNum = "${p}";
        $('.js_appUser_delete').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${basePath}/admin/appUser/delete.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });

        $('.js_appUser_on').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${basePath}/admin/appUser/getOn.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });


        $('.js_hot_set').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${basePath}/admin/appUser/hotSet.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });

        $('.js_hot_cancel').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${basePath}/admin/appUser/hotCancel.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });
    });
</script>
<#include "foot.ftl">
